package com.millstein.exception;

import com.millstein.enums.BizCodeEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description:
 * @author: tsing
 * @create: 2021-09-09 20:49
 */
@Data
@NoArgsConstructor
public class BizException extends RuntimeException {
    private int code;
    private String message;

    public BizException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizException(BizCodeEnum bizCodeEnum) {
        this.code = bizCodeEnum.getCode();
        this.message = bizCodeEnum.getMessage();
    }
}
